'use strict';var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(e){var m=0;return function(){return m>>0,$jscomp.propertyToPolyfillSymbol[a]=$jscomp.IS_SYMBOL_NATIVE? $jscomp.global.Symbol(a):$jscomp.POLYFILL_PREFIX+r+"$"+a),$jscomp.defineProperty(h,$jscomp.propertyToPolyfillSymbol[a],{configurable:!0,writable:!0,value:m})))};$jscomp.initSymbol=function(){}; $jscomp.polyfill("Symbol",function(e){if(e)return e;var m=function(b,g){this.$jscomp$symbol$id_=b;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:g})};m.prototype.toString=function(){return this.$jscomp$symbol$id_};var r="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",h=0,a=function(b){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new m(r+(b||"")+"_"+h++,b)};return a},"es6","es3"); $jscomp.polyfill("Symbol.iterator",function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var m="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),r=0;rn&&(n=0);l+=n;f.push(l);return l},0);return 0===k?f:f.map(function(l){return l/k})}function m(d){for(var f=Math.random(),k=d.length,l=0;l=window.innerWidth;z&&window.Insticator.load("infiniteScroll",{});C.forEach(function(p){return g(void 0,void 0,void 0,function t(){var y;return $jscomp.generator.createGenerator(t,function(B){switch(B.nextAddress){case 1:if("MOBILE"===p.deviceType&&!A){c.logger.error('Group "'+p.id+'" not rendered: Device type is MOBILE, but current device is DESKTOP');B.jumpTo(0);break}if("DESKTOP"===p.deviceType&&A){c.logger.error('Group "'+p.id+'" not rendered: Device type is DESKTOP, but current device is MOBILE'); B.jumpTo(0);break}if(p.isInfiniteScrollEnabled&&("INLINE"!==p.layout||"NONE"!==p.trigger)){B.jumpTo(4);break}if("CONTROL_BAR"===p.trigger&&"INLINE"!==p.layout){y=v(p.urlFilter)?(c.logger.log('Group "'+p.id+'" loaded'),void window.Insticator.load("insticator-product-group",{id:p.id,internalCall:!0})):void c.logger.error('Group "'+p.id+'" not rendered: URL filter does not match current URL. Filter: '+p.urlFilter);B.jumpTo(5);break}"CUSTOM"===p.trigger&&(c.logger.log('Group "'+p.id+'" loaded'),window.Insticator.load("insticator-product-group", {id:p.id,internalCall:!0}));if("INLINE"!==p.layout&&"BUTTON"!==p.trigger){B.jumpTo(6);break}return B.yield(g(void 0,void 0,void 0,function E(){var G;return $jscomp.generator.createGenerator(E,function(H){if(1==H.nextAddress){if(p.isDynamic||c.logger.log('Group "'+p.id+"\" is loaded in hardcode mode.\nWaiting for body code to call Insticator.load('insticator-product-group', { id: "+p.id+" })"),!p.isDynamic)return H.jumpTo(0);if(!v(p.urlFilter))return H.return(void c.logger.log('Group "'+p.id+'" not rendered: URL filter does not match current URL. Filter: '+ p.urlFilter));c.logger.log('Group "'+p.id+'" loaded in dynamic mode. '+p.selectorMode+" selector: "+p.selector);return H.yield((0,f.resolveDynamicGroupSelector)(p),3)}G=H.yieldResult;if(!G)return H.return(void c.logger.error('Group "'+p.id+'" not rendered: Could not find element to insert after. Selector '+p.selectorMode+": "+p.selector));c.logger.log('Inserted dynamic container for group "'+p.id+'" after:',G);(0,d.insertDynamicGroupContainer)(p,G);window.Insticator.load("insticator-product-group", {id:p.id,internalCall:!0});H.jumpToEnd()})}),7);case 7:case 6:y=void 0;case 5:return B.return(y);case 4:c.logger.error('Group "'+p.id+'" not rendered: Infinite scroll is enabled, but layout is not INLINE or trigger is not NONE'),B.jumpToEnd()}})})})}(x.groupsConfigs)):c.logger.log("No product manager config found");u.jumpToEnd()})})}},912:function(h,a){Object.defineProperty(a,"__esModule",{value:!0});a.insertDynamicGroupContainer=void 0;a.insertDynamicGroupContainer=function(b,g){var c=document.createElement("div"); return c.setAttribute("class","insticator-product-group"),c.setAttribute("data-insticator-group-id",b.id),c.setAttribute("data-dynamic","true"),g.after(c),c}},771:function(h,a,b){Object.defineProperty(a,"__esModule",{value:!0});a.getProductManagerConfig=void 0;var g=b(378),c,d=function(f){var k=[];return f.showCommenting&&k.push({product:"COMMENTING",order:f.commentingOrder}),f.showTrendingNow&&k.push({product:"TRENDING_NOW",order:f.trendingNowOrder}),f.showArticleSentiment&&k.push({product:"ARTICLE_SENTIMENT", order:f.articleSentimentOrder}),k.sort(function(l,n){return l.order-n.order}).map(function(l){return l.product})};a.getProductManagerConfig=function(){if(window.mockInsticatorProductManagerConfig){var f=window.mockInsticatorProductManagerConfig.groupsConfigs[0];return f.draft&&(window.mockInsticatorProductManagerConfig.groupsConfigs[0]=Object.assign({id:f.id},f.draft)),window.mockInsticatorProductManagerConfig.groupsConfigs[0]=Object.assign(Object.assign({},window.mockInsticatorProductManagerConfig.groupsConfigs[0]), {layout:"INLINE",trigger:"NONE"}),window.mockInsticatorProductManagerConfig}if(c)return c;if((f=window.Insticator.productManagerConfig)&&window.Insticator.commentingUnitId){var k={isCommentsCounterEnabled:f.commentsCounterEnabled,commentingUnitId:window.Insticator.commentingUnitId,trendingNowId:window.Insticator.trendingNowId,articleSentimentId:window.Insticator.articleSentimentId,groupsConfigs:[]};return f.groupConfigList.forEach(function(l){var n=g.isDraftMode?l.draft:l.current;if(n.groupEnabled){var v= n.layout||"INLINE",F=n.trigger||"NONE",w=n.deviceType||"ALL";l={id:l.groupId,label:n.label,isInfiniteScrollEnabled:n.infiniteScrollEnabled,isDynamic:n.dynamicPlacement,selectorMode:n.selectorMode,selector:n.selector,urlFilter:n.urlFilter,productsOrder:d(n),layout:v,trigger:F,deviceType:w};k.groupsConfigs.push(l)}}),c=k,k}}},910:function(h,a){Object.defineProperty(a,"__esModule",{value:!0});a.appendDataParams=void 0;a.appendDataParams=function(b,g){Object.keys(g).forEach(function(c){var d=g[c];d&& (c=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),b.setAttribute("data-"+c,d))})}},439:function(h,a,b){var g=this&&this.__awaiter||function(v,F,w,x){return new (w||(w=Promise))(function(u,C){function z(q){try{p(x.next(q))}catch(t){C(t)}}function A(q){try{p(x.throw(q))}catch(t){C(t)}}function p(q){var t;q.done?u(q.value):(t=q.value,t instanceof w?t:new w(function(y){y(t)})).then(z,A)}p((x=x.apply(v,F||[])).next())})};Object.defineProperty(a,"__esModule",{value:!0});a.renderProductGroup=void 0; var c=b(473),d=b(676),f=b(771),k=b(702),l=new Map;l.set("COMMENTING","core-commenting");l.set("ARTICLE_SENTIMENT","article-sentiment");l.set("TRENDING_NOW","trending-now");var n=!1;a.renderProductGroup=function(v){return g(void 0,void 0,void 0,function w(){var x,u,C,z,A,p,q,t,y;return $jscomp.generator.createGenerator(w,function(B){if(1==B.nextAddress)return B.yield((0,k.waitTillPMCDefined)(),2);x=(0,f.getProductManagerConfig)();if(!x||!x.groupsConfigs||!v)return B.return(void c.logger.error("No product manager config found or missing params")); u=x.groupsConfigs.find(function(D){return D.id===v.id});if(!u)return B.return(void c.logger.error("No group config found for id: "+v.id));C="INLINE"===u.layout||"BUTTON"===u.trigger;if(!C&&!v.internalCall)return B.return(void c.logger.error('Group "'+u.id+'" not rendered: Group layout "'+u.layout+'" and trigger "'+u.trigger+'" does not support body code'));if(C&&!v.internalCall&&u.isDynamic)return B.return(void c.logger.error('Group "'+u.id+'" not rendered: Dynamic group .load should be called from internal dynamic insertion')); z=568>=window.innerWidth;if("MOBILE"===u.deviceType&&!z)return B.return(void c.logger.error('Group "'+u.id+'" not rendered: Device type is MOBILE, but current device is DESKTOP'));if("DESKTOP"===u.deviceType&&z)return B.return(void c.logger.error('Group "'+u.id+'" not rendered: Device type is DESKTOP, but current device is MOBILE'));A=u.isInfiniteScrollEnabled;p=!("INLINE"===u.layout&&"NONE"===u.trigger);q="BUTTON"===u.trigger||"INLINE"===u.layout;t="INLINE"===u.layout&&!("BUTTON"===u.trigger||"CUSTOM"=== u.trigger);if(q){y=function(D,E){var G='.insticator-product-group[data-insticator-group-id\x3d"'+D+'"]';E.isDynamic&&(G+='[data-dynamic\x3d"true"]');if(E=document.querySelector(G+':not([rendered\x3d"true"]'))return E;c.logger.error("No container found for group: "+D)}(u.id,u);if(!y)return B.return(void c.logger.error("No container found for group: "+u.id));if(c.logger.log('Rendering group "'+u.id+'":',y,"\nproducts:",u.productsOrder.join(", ")),A&&!(v.pageFromProps&&v.pageFromProps.pageId&&v.pageFromProps.pageUrl&& v.pageFromProps.pageTitle))return B.return(void c.logger.error('Missing pageId, pageUrl and pageTitle in infinite scroll body code for group "'+u.id+'"'));(t||v.forceProductsRender)&&(c.logger.log('Group "'+u.id+'" products rendere without advanced layout'),y.setAttribute("rendered","true"),u.productsOrder.forEach(function(D){var E=d.productBodyCodeRenderers[D]({pageData:A?v.pageFromProps:v.pageFromHeader});y.appendChild(E);(D=l.get(D))&&window.Insticator.load(D,{})}))}p&&(n?c.logger.error('Advanced layout already loaded once. Skipping the group "'+ u.id+'"...'):(c.logger.log('Advanced layout required for group "'+u.id+'"'),window.Insticator.load("advanced-group-layout",{id:u.id}),n=!0));B.jumpToEnd()})})}},676:function(h,a,b){Object.defineProperty(a,"__esModule",{value:!0});a.productBodyCodeRenderers=void 0;var g=b(910),c=b(771);h=function(d){return function(f){var k,l,n,v=document.createElement("div");v.setAttribute("class",d.class);f=Object.assign(Object.assign({},null!==(k=null==f?void 0:f.pageData)&&void 0!==k?k:{}),(null===(l=d.getAdditionalDataParams)|| void 0===l?void 0:l.call(d))||{});return(0,g.appendDataParams)(v,f),d.appendToContainer&&d.appendToContainer.appendChild(v),null!==(n=d.appendToContainer)&&void 0!==n?n:v}};a.productBodyCodeRenderers={COMMENTING:h({class:"instiengage-core-commenting",getAdditionalDataParams:function(){var d,f;return{cuid:null!==(f=null===(d=(0,c.getProductManagerConfig)())||void 0===d?void 0:d.commentingUnitId)&&void 0!==f?f:""}}}),ARTICLE_SENTIMENT:h({class:"instiengage-article-sentiment",getAdditionalDataParams:function(){var d, f;return{asuid:null!==(f=null===(d=(0,c.getProductManagerConfig)())||void 0===d?void 0:d.articleSentimentId)&&void 0!==f?f:""}}}),TRENDING_NOW:h({class:"instiengage-trending-now",getAdditionalDataParams:function(){var d,f;return{tnuid:null!==(f=null===(d=(0,c.getProductManagerConfig)())||void 0===d?void 0:d.trendingNowId)&&void 0!==f?f:""}}})};window.INSTICATOR_BODY_CODE_RENDERERS=a.productBodyCodeRenderers},830:function(h,a){var b=this&&this.__awaiter||function(g,c,d,f){return new (d||(d=Promise))(function(k, l){function n(w){try{F(f.next(w))}catch(x){l(x)}}function v(w){try{F(f.throw(w))}catch(x){l(x)}}function F(w){var x;w.done?k(w.value):(x=w.value,x instanceof d?x:new d(function(u){u(x)})).then(n,v)}F((f=f.apply(g,c||[])).next())})};Object.defineProperty(a,"__esModule",{value:!0});a.resolveDynamicGroupSelector=void 0;a.resolveDynamicGroupSelector=function(g){return b(void 0,void 0,void 0,function d(){return $jscomp.generator.createGenerator(d,function(f){return f.return(new Promise(function(k){(function(l, n,v){n=void 0===n?20:n;v=void 0===v?200:v;return b(void 0,void 0,void 0,function w(){return $jscomp.generator.createGenerator(w,function(x){return x.return(new Promise(function(u,C){var z=0,A=function(){var p=(q=l.selectorMode,t=l.selector,"CSS"===q?document.querySelector(t):"XPATH"===q?document.evaluate(t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue:null),q,t;p?u(p):(z++,z